/*-------------------------------------<-- Start of Header -->-------------------------------------\ | Version: 1.0 | | Author: Duo Zhou | | Title: Statistician | | Date: April 15, 2002 | | File Path: C:\Programs\StatSoft\SAS Institute\SAS\MyOwnSetting\sasmacro\GenHeader.sas | |---------------------------------------<-- End of Header -->--------------------------------------| |--------------------------------------------------------------------------------------------------| |-----------------------------------<-- Start of Description -->-----------------------------------| | Purpose: Generate Program Header for Statistics Programs Validation | |------------------------------------<-- End of Description -->------------------------------------| |--------------------------------------------------------------------------------------------------| |-----------------------------------<-- Start of Parameters -->----------------------------------- | | Parameters: | | filename - Program Name; | | path - path of the file; | | tofile - write the header to the file you just listed as path; Note: the program will | | read the original file, and append a header at front, then write everything | | back. Be careful about this option, it will overwrite the original files. If | | error occurs, the original files will be lost permanently; | | version - Version of the file; | | author - Author of the file; | | title - Title of the Author; | | date - Date of the program; | | lib - Libraries defined in the program. Note: different libraries need to be | | defined like this (lib1 c:\temp\); | | infile - Input Files, including datasets and documents. Note: different type of files | | need to be defined like this (Indata: acedcrf.impl acedcrf.ae; | | Infile - temp\temp.doc ...), all subsections separated by the PHI delimiter will be | | starting from a different line; | | outfile - Output Files, including datasets and documents Note: this parameter should look | | like the above parameter, comment - Comments, Notes and References Note: the | | parameter should look like the above parameter too | |------------------------------------<-- End of Parameters -->------------------------------------ | |--------------------------------------------------------------------------------------------------| |-------------------------------------<-- Start of Comments -->------------------------------------| | Comments: | | Usage: GenHeader(filename=, path=, tofile=F, version=1.0, author=Duo Zhou, | | title=Statistician, date=, study=, purpose=, macropara=, lib=, infile=, | | outfile=, comment=) | \--------------------------------------<-- End of Comments -->------------------------------------*/ %macro GenHeader(file=, path=, tofile=F, version=1.0, author=Duo Zhou, title=Statistician, date=(%sysfunc(date(), worddate20.)), valdate=, moddate=, purpose=, study=, description=, macropara=(:|:), lib=(|), infile=(|), outfile=(|), comment=(|)); /*---------------------------------------------\ | Copy Right: Duo Zhou; | | Created: 4-14-2001 4:16pm; | | Purpose: Generate Program Headers; | \---------------------------------------------*/ %local file path tofile version author title date valdate moddate purpose study description macropara lib infile outfile comment linesize _substr1_ _currstr1_ _subscnt1_ _wordsub1_ _lines1_ _substr2_ _currstr2_ _subscnt2_ _wordsub2_ _lines2_ _paraname_ _substr3_ _currstr3_ _subscnt3_ _wordsub3_ _lines3_ _npara_ _parameter_ _nlib_ _libname_ _substr4_ _currstr4_ _subscnt4_ _wordsub4_ _lines4_ _library_ _substr5_ _currstr5_ _subscnt5_ _wordsub5_ _lines5_ _nfile_ _filename_ _filel_ _dlm_ _substr6_ _currstr6_ _subscnt6_ _wordsub6_ _lines6_ _nfilec_ _filecname_ _filec_ _dlmc_ _substr7_ _currstr7_ _subscnt7_ _wordsub7_ _lines7_ _ncomm_ _commcnt_ _commitem_ _dlmcomm_ _tmplast_; %let _tmplast_=&syslast; %let linesize = %SYSFUNC(GETOPTION(linesize)); %let pagesize = %SYSFUNC(GETOPTION(pagesize)); options ls=96 nocenter ps=1024; %let filepath=; %if (%quote(&path) ne) %then %do; %let path=%sysfunc(compress(%quote(%sysfunc(compress(%quote(%trim(%quote(%left(%quote(&path))))), '"'))), "'")); %let path=%sysfunc(translate(%quote(&path), %str(\), %str(/))); %end; %if (%quote(&file) ne) %then %do; %let file=%sysfunc(compress(%quote(%sysfunc(compress(%quote(%trim(%quote(%left(%quote(&file))))), '"'))), "'")); %let file=%sysfunc(translate(%quote(&file), %str(\), %str(/))); %if (not %index(%quote(&file), %str(\))) and (%quote(&path) eq) %then %do; %if (%quote(%upcase(%substr(%quote(&file),%eval(%length(&file)-3),4))) eq %quote(.SAS)) %then %do; %pwd(%qscan(&file, 1, %str(.)), T); %end; %else %do; %pwd(&file, T); %let file=%trim(%left(&file)).sas; %end; %let path=&_programPath; %end; %end; %if (%index(%quote(&file), %str(\))) %then %do; %let path=&file; %let file=; %end; %if (%length(&path) >=3) %then %do; %if (%quote(&file) ne) %then %let file=%sysfunc(dequote(&file)); %else %if (%quote(&path) ne) %then %let file=%sysfunc(reverse(%qscan(%quote(%sysfunc(reverse(&path))), 1, %str(\)))); %if (%quote(&path) ne) %then %let path=%sysfunc(dequote(&path)); %if (%sysfunc(fileexist(&path))) %then %do; %if (%quote(%upcase(%substr(%quote(&path),%eval(%length(&path)-3),4))) eq %quote(.SAS)) %then %do; %let filepath=%substr(%quote(&path), 1, %eval(%length(&path)-%length(&file))); filename _pfile_ "&path"; %if (%index(%quote(%upcase(&tofile)), T)) %then %do; DATA _tmp1_; infile _pfile_ length=linelen end=done; length linecontent $ 2000; do while(not done); input @1 linecontent $ varying2000. linelen; output; end; keep linecontent; run; data _null_; file _pfile_; set _tmp1_; %end; %else %do; data _null_; file print; linecontent = ' '; %end; %end; %else %do; %put ==> Alert! Can not find File "%trim(%left(%upcase(&path)))"!; data _null_; file print; linecontent = ' '; %end; %end; %else %do; %put ==> Alert! File "%trim(%left(%upcase(&path)))" does not exist!; data _null_; file print; linecontent = ' '; %end; %end; %else %do; %put ==> Alert! File "%trim(%left(%upcase(&path)))" does not exist!; data _null_; file print; linecontent = ' '; %end; length str1 str2 $2000.; retain position 17; if _n_=1 then do; put #1 '/*' 35*'-' '<-- Start of Header -->' 35*'-' @96 '\'; %if (%length(&file) gt 3) %then %do; %let file=%sysfunc(tranwrd(%nrbquote(&file), %str(%"), %str(%'))); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&file)))))))))) ne 1) %then %let file=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&file))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&file)))))); %let file=&file; /* %else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&file)))), %str(;)) ne 1) %then %let file=&file%str(;);*/ str1 ="Program: "; str2= trimn(left("&file")); put '| ' str1 @position str2 @96 @@; %end; %if (%length(&study) gt 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&study)))))))))) ne 1) %then %let study=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&study))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&study)))))); %let study=&study; /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&study)))), %str(;)) ne 1) %then %let study=&study%str(;);*/ str1="Study: "; str2=trimn(left("&study")); put @50 str1 @58 str2 @96 '|'; %end; %if (%length(&version) gt 0) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&version)))))))))) ne 1) %then %let version=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&version))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&version)))))); %let version=&version; /*%if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&version)))))))))) ne 1) %then %let version=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&version))))), 1, %eval(%length(%trim(%nrbquote(%left(%nrbquote(&version)))))-1))%str(;)*/; /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&version)))), %str(;)) ne 1) %then %let version=&version%str(;);*/ str1="Version: "; str2=trimn(left("&version")); put '| ' str1 @position str2 @@; %end; %if (%length(&author) gt 0) %then %do; %let author=%sysfunc(compress(&author, '()')); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&author)))))))))) ne 1) %then %let author=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&author))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&author)))))); %let author=&author; /* %else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&author)))), %str(;)) ne 1) %then %let author=&author%str(;);*/ str1="Author: "; str2=trimn(left("&author")); put @50 str1 @58 str2 @96 '|'; %end; %if (%length(&date) gt 3) %then %do; %let date=%sysfunc(compress(%quote(&date), ')(')); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&date)))))))))) ne 1) %then %let date=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&date))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&date)))))); %let date=&date; /* %else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&date)))), %str(;)) ne 1) %then %let date=&date%str(;);*/ str2=trimn(left("&date")); put '| ' "Date: " @position str2 @@; %end; %if (%length(&title) gt 3) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&title)))))))))) ne 1) %then %let title=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&title))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&title))))))%str(;); %let title=&title; /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&title)))), %str(;)) ne 1) %then %let title=&title%str(;);*/ str1="Title: "; str2=trimn(left("&title")); put @50 str1 @58 str2 @96 '|'; %end; %if (%length(&moddate) gt 3) %then %do; %let moddate=%sysfunc(compress(&moddate, '()')); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&moddate)))))))))) ne 1) %then %let moddate=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&moddate))))), 1, %%length(%trim(%nrbquote(%left(%nrbquote(&moddate)))))); %let moddate=&moddate; /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&moddate)))), %str(;)) ne 1) %then %let moddate=&moddate%str(;);*/ str1="Modification: "; str2=trimn(left("&moddate")); put '| ' str1 @position str2 @96 '|'; %end; %if (%length(&valdate) gt 3) %then %do; %let valdate=%sysfunc(compress(&valdate, ')(')); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&valdate)))))))))) ne 1) %then %let valdate=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&valdate))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&valdate)))))); %let valdate=&valdate; /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&valdate)))), %str(;)) ne 1) %then %let valdate=&valdate%str(;);*/ str1="Validation: "; str2=trimn(left("&valdate")); put '| ' str1 @position str2 @96 '|' @@; %end; %if (%length(%nrbquote(&path)) gt 3) %then %do; str1 ="Path: "; put '| ' str1 @@; %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&path))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&path)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(&path))) gt 1) %then %let path=%nrbquote(%substr(%nrbquote(&path), 2, %eval(%length(%nrbquote(&path))-2))); %else %let path=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&path))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&path))))))-2))); %end; %let path=%sysfunc(compbl(%quote(&path))); %if ((%index(%nrbquote(&path),%str(%')) and %index(%nrbquote(&path),%str(%')<2)) or (%index(%nrbquote(&path),%str(%")) and %index(%nrbquote(&path),%str(%")) lt 2)) %then %do; %let path=%nrbquote(%sysfunc(dequote(&path))); %end; %let path=&path; %let path=%bquote(%sysfunc(tranwrd(%nrbquote(&path), %str(%(), %str(À)))); %let path=%bquote(%sysfunc(tranwrd(%nrbquote(&path), %str(%)), %str(Á)))); %let path=%bquote(%sysfunc(tranwrd(%nrbquote(&path), %str(%%), %str(Â)))); %let path=%bquote(%sysfunc(tranwrd(%nrbquote(&path), %str(%'), %str(¸)))); %let path=%bquote(%sysfunc(tranwrd(%nrbquote(&path), %str(%"), %str(¹)))); %let path=%qcmpres(&path); %let _npath_=0; %do %while(%length(%qscan(%quote(&path), %eval(&_npath_+1), %str(|)))); %let _npath_=%eval(&_npath_+1); %let _pathitem_=%qscan(%quote(&path), &_npath_, %str(|)); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&_pathitem_)))))))))) ne 1) %then %let _pathitem_=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_pathitem_))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&_pathitem_)))))); /* %else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_pathitem_)))), %str(;)) ne 1) %then %let _pathitem_=&_pathitem_%str(;);*/ %let _slashposp_=%index(%nrbquote(&_pathitem_),%str(\)); %if (&_slashposp_ ge 1) %then %do; %if (&_slashposp_ ge 90) %then %let _dlmpath_=%quote( ); %else %if (%index(%nrbquote(&_pathitem_),%str( ))) and (%index(%nrbquote(&_pathitem_),%str( )) le 89) %then %do; %if (&_slashposp_ gt %index(%nrbquote(&_pathitem_),%str( ))) and (%eval(%length(&_pathitem_) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_pathitem_)))),%str(\))) ge 90) %then %let _dlmpath_=%quote(\); %else %let _dlmpath_=%quote( ); %end; %else %let _dlmpath_=%quote(\); %end; %else %let _dlmpath_=%str( ); %let _linesp_=1; %do %while(%length(&_pathitem_)>78); %let _slashposp_=%index(%nrbquote(&_pathitem_),%str(\)); %if (&_slashposp_ ge 1) %then %do; %if (&_slashposp_ ge 79) %then %let _dlmpath_=%quote( ); %else %if (%index(%nrbquote(&_pathitem_),%str( ))) and (%index(%nrbquote(&_pathitem_),%str( )) le 89) %then %do; %if (&_slashposp_ gt %index(%nrbquote(&_pathitem_),%str( ))) and (%eval(%length(&_pathitem_) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_pathitem_)))),%str(\))) ge 90) %then %let _dlmpath_=%quote(\); %else %let _dlmpath_=%quote( ); %end; %else %let _dlmpath_=%quote(\); %end; %else %let _dlmpath_=%str( ); %let _substrp_=%substr(%quote(%left(%quote(&_pathitem_))), 1, 78); %if (%quote(%substr(%quote(%left(%quote(&_pathitem_))), 79, 1)) eq %quote(&_dlmpath_)) %then %do; %let _pathitem_=%substr(%quote(%left(%quote(&_pathitem_))), 79, %eval(%length(%left(%quote(&_pathitem_)))-89)); %let _currstrp_=&_substrp_; %end; %else %do; %let _currstrp_=; %let _subscntp_=0; %do %while(%length(%qscan(%quote(&_substrp_), %eval(&_subscntp_+1), %str(&_dlmpath_)))); %let _subscntp_=%eval(&_subscntp_+1); %let _wordsubp_=%qscan(%quote(&_substrp_), &_subscntp_, %str(&_dlmpath_)); %if (%length(%quote(%qscan(%quote(&_substrp_), %eval(&_subscntp_+1), %str(&_dlmpath_))))) %then %do; %if (%quote(&_dlmpath_) eq %quote(\)) %then %let _currstrp_=%trim(%quote(%left(%quote(&_currstrp_))))%trim(%quote(%left(%quote(&_wordsubp_))))%str(&_dlmpath_); %else %let _currstrp_=%trim(%quote(%left(%quote(&_currstrp_))))%str(&_dlmpath_)%trim(%quote(%left(%quote(&_wordsubp_)))); %let _pathitem_=%left(%quote(&_pathitem_)); %let _pathitem_=%substr(%quote(&_pathitem_), %eval(%length(&_wordsubp_)+2), %eval(%eval(%length(&_pathitem_)-%length(&_wordsubp_))-1)); %end; %end; %end; str2=trimn(left("&_currstrp_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_linesp_ eq 1) %then %do; put @17 str2 @96 '|'; %end; %else %do; put '|' @17 str2 @96 '|'; %end; %let _linesp_=%eval(&_linesp_+1); %end; str2=trimn(left("&_pathitem_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_linesp_ eq 1) %then %do; put @17 str2 @96 '|'; %end; %else %do; put '|' @17 str2 @96 '|'; %end; %if (%length(%qscan(%quote(&path), %eval(&_npath_+1), %str(|)))) %then %do; put '|' 94*' ' '|'; %end; %end; %end; %if (%length(%nrbquote(&purpose)) gt 2) %then %do; %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&purpose))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&purpose)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(&purpose))) gt 1) %then %let purpose=%nrbquote(%substr(%nrbquote(&purpose), 2, %eval(%length(%nrbquote(&purpose))-2))); %else %let purpose=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&purpose))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&purpose))))))-2))); %end; %let purpose=%nrbquote(%sysfunc(compbl(%nrbquote(&purpose)))); str1="Purpose: "; %let _lines1_=1; %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&purpose)))))))))) ne 1) %then %let purpose=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&purpose))))), 1, %length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&purpose)))))))); /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&purpose)))), %str(;)) ne 1) %then %let purpose=%nrbquote(&purpose)%str(;); */ %do %while(%length(%nrbquote(&purpose))>82); %let _substrpur_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&purpose))), 1, 82)); %if (%nrbquote(%substr(%nrbquote(%left(%nrbquote(&purpose))), 83, 1)) eq %quote( )) %then %do; %let purpose=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&purpose))), 83, %eval(%length(%nrbquote(&purpose))-82))); %let _currstrpur_=%nrbquote(&_substrpur_); %end; %else %do; %let _currstrpur_=; %let _subcntpur_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&_substrpur_), %eval(&_subcntpur_+1), %str( ))))); %let _subcntpur_=%eval(&_subcntpur_+1); %let _wordsubpur_=%nrbquote(%qscan(%nrbquote(&_substrpur_), &_subcntpur_, %str( ))); %if (%length(%nrbquote(%qscan(%nrbquote(&_substrpur_), %eval(&_subcntpur_+1), %str( ))))) %then %do; %let _currstrpur_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstrpur_)))))%quote( )%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsubpur_))))); %let purpose=%nrbquote(%left(%nrbquote(&purpose))); %let purpose=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&purpose))), %eval(%length(%nrbquote(&_wordsubpur_))+2), %eval(%length(%nrbquote(&purpose))-%eval(%length(%nrbquote(&_wordsubpur_))+1)))); %end; %end; %end; str2=trimn(left("&_currstrpur_")); %if (&_lines1_ eq 1) %then %do; put '| ' str1 @position str2 @96 '|'; %end; %else %do; put '|' @position str2 @96 '|'; %end; %let _lines1_=%eval(&_lines1_+1); %end; str2=trimn(left("&purpose")); %if (&_lines1_ eq 1) %then %do; put '| ' str1 @position str2 @96 '|'; %end; %else %do; put '|' @position str2 @96 '|'; %end; %end; put '|' 37*'-' '<-- End of Header -->' 36*'-' @96 '|'; put '|' 94*'-' '|'; %if (%length(%nrbquote(&description)) gt 3) %then %do; put '|' 33*'-' '<-- Start of Description -->' 33*'-' @96 '|'; str1=""; %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&description))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&description)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(&description))) gt 1) %then %let description=%nrbquote(%substr(%nrbquote(&description), 2, %eval(%length(%nrbquote(&description))-2))); %else %let description=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&description))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&description))))))-2))); %end; %let description=%nrbquote(%sysfunc(compbl(%nrbquote(&description)))); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&description)))))))))) ne 1) %then %let description=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&description))))), 1, %length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&description))))))))); /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&description)))), %str(;)) ne 1) %then %let description=%nrbquote(&description)%str(;); */ %if ((%index(%nrbquote(&description),%str(%')) and %index(%nrbquote(&description),%str(%')<2)) or (%index(%nrbquote(&description),%str(%")) and %index(%nrbquote(&description),%str(%")) lt 2)) %then %do; %let description=%nrbquote(%sysfunc(dequote(%nrbquote(&description)))); %end; %let description=%nrbquote(%sysfunc(tranwrd(%nrbquote(&description), %quote(, |), %str(|)))); %let description=%nrbquote(%sysfunc(tranwrd(%nrbquote(&description), %quote(,|), %str(|)))); %let description=%nrbquote(%sysfunc(tranwrd(%nrbquote(&description), %str(%(), %str(À)))); %let description=%nrbquote(%sysfunc(tranwrd(%nrbquote(&description), %str(%)), %str(Á)))); %let description=%nrbquote(%sysfunc(tranwrd(%nrbquote(&description), %str(%%), %str(Â)))); %let description=%nrbquote(%sysfunc(tranwrd(%nrbquote(&description), %str(%'), %str(¸)))); %let description=%nrbquote(%sysfunc(tranwrd(%nrbquote(&description), %str(%"), %str(¹)))); %let description=%nrbquote(%qcmpres(%nrbquote(&description))); %let _lines2_=1; %do %while(%length(%nrbquote(&description))>93); %let _substr2_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&description))), 1, 93)); %if (%nrbquote(%substr(%nrbquote(%left(%nrbquote(&description))), 94, 1)) eq %quote( )) %then %do; %let description=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&description))), 94, %eval(%length(%nrbquote(&description))-93))); %let _currstr2_=%nrbquote(&_substr2_); %end; %else %do; %let _currstr2_=; %let _subscnt2_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&_substr2_), %eval(&_subscnt2_+1), %str( ))))); %let _subscnt2_=%eval(&_subscnt2_+1); %let _wordsub2_=%nrbquote(%qscan(%nrbquote(&_substr2_), &_subscnt2_, %str( ))); %if (%length(%nrbquote(%qscan(%nrbquote(&_substr2_), %eval(&_subscnt2_+1), %str( ))))) %then %do; %let _currstr2_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr2_)))))%str( )%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub2_))))); %let description=%nrbquote(%left(%nrbquote(&description))); %if (%length(%nrbquote(&description)) ge %eval(%length(%nrbquote(&_wordsub2_))+2)) %then %let description=%nrbquote(%substr(%nrbquote(&description), %eval(%length(%nrbquote(&_wordsub2_))+2), %eval(%eval(%length(%nrbquote(&description))-%length(%nrbquote(&_wordsub2_)))-1))); %end; %end; %end; str2=trimn(left("&_currstr2_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); put '|' @3 str2 @96 '|'; %end; str2=trimn(left("&description")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); put '| ' @3 str2 @96 '|'; put '|' 34*'-' '<-- End of Description -->' 34*'-' @96 '|'; put '|' 94*'-' '|'; %end; %if (%length(%nrbquote(¯opara)) gt 5) %then %do; put '|' 34*'-' '<-- Start of Parameters -->' 33*'-' @96 '|'; str1="Parameters: "; put '| ' str1 @96 '|'; %let macropara=%nrbquote(%sysfunc(compbl(%nrbquote(¯opara)))); %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(¯opara))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(¯opara)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(¯opara))) gt 1) %then %let macropara=%nrbquote(%substr(%nrbquote(¯opara), 2, %eval(%length(%nrbquote(¯opara))-2))); %else %let macropara=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(¯opara))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(¯opara))))))-2))); %end; %if ((%index(%nrbquote(¯opara),%str(%')) and %index(%nrbquote(¯opara),%str(%')<2)) or (%index(%nrbquote(¯opara),%str(%")) and %index(%nrbquote(¯opara),%str(%")) lt 2)) %then %do; %let macropara=%nrbquote(%sysfunc(dequote(%nrbquote(¯opara)))); %end; %let macropara=%nrbquote(%sysfunc(tranwrd(%nrbquote(¯opara), %quote(, |), %str(|)))); %let macropara=%nrbquote(%sysfunc(tranwrd(%nrbquote(¯opara), %quote(,|), %str(|)))); %let macropara=%nrbquote(%sysfunc(tranwrd(%nrbquote(¯opara), %str(%(), %str(À)))); %let macropara=%nrbquote(%sysfunc(tranwrd(%nrbquote(¯opara), %str(%)), %str(Á)))); %let macropara=%nrbquote(%sysfunc(tranwrd(%nrbquote(¯opara), %str(%%), %str(Â)))); %let macropara=%nrbquote(%sysfunc(tranwrd(%nrbquote(¯opara), %str(%'), %str(¸)))); %let macropara=%nrbquote(%sysfunc(tranwrd(%nrbquote(¯opara), %str(%"), %str(¹)))); %let macropara=%nrbquote(%qcmpres(%nrbquote(¯opara))); %let _maxparamnamelen_=0; %let _ntmp_=0; %let _paraname_=; %do %while(%length(%nrbquote(%qscan(%nrbquote(¯opara), %eval(&_ntmp_+1), %str(|))))); %let _ntmp_=%eval(&_ntmp_+1); %let _paraname_=%nrbquote(%qscan(%nrbquote(%qscan(%nrbquote(¯opara), &_ntmp_, %str(|))), 1, %str( -:))); %if (&_maxparamnamelen_ gt %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_paraname_))))))+1)) %then %let _maxparamnamelen_=&_maxparamnamelen_; %else %if (&_maxparamnamelen_ lt %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_paraname_))))))+1)) %then %let _maxparamnamelen_= %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_paraname_))))))+1); %end; %let _parameter_=; %let _npara_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(¯opara), %eval(&_npara_+1), %str(|))))); %let _npara_=%eval(&_npara_+1); %let _parameter_=%nrbquote(%qscan(%nrbquote(¯opara), &_npara_, %str(|))); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&_parameter_)))))))))) ne 1) %then %let _parameter_=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_parameter_))))), 1, %length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_parameter_)))))))); /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_parameter_)))), %str(;)) ne 1) %then %let _parameter_=%nrbquote(&_parameter_)%str(;); */ %let _paraname_ =%nrbquote(%qscan(%nrbquote(&_parameter_), 1 , %str( -:))); %let _parameter_=%nrbquote(%left(%nrbquote(%substr(%nrbquote(&_parameter_), %eval(%length(%nrbquote(&_paraname_))+2), %eval(%eval(%length(%nrbquote(&_parameter_))-%length(%nrbquote(&_paraname_)))-1))))); %if (%index(%nrbquote(&_parameter_),%str(-)) and %index(%nrbquote(&_parameter_),%str(-)) lt 5) %then %do; %let _parameter_=%nrbquote(%left(%nrbquote(%substr(%nrbquote(&_parameter_), %eval(%index(%nrbquote(&_parameter_), %str(-))+2), %eval(%eval(%length(%nrbquote(&_parameter_))-%index(%nrbquote(&_parameter_), %str(-)))-1))))); %end; %else %if (%index(%nrbquote(&_parameter_),%str(:)) and %index(%nrbquote(&_parameter_),%str(:)) lt 5) %then %do; %let _parameter_=%nrbquote(%left(%nrbquote(%substr(%nrbquote(&_parameter_), %eval(%index(%nrbquote(&_parameter_), %str(:))+2), %eval(%eval(%length(%nrbquote(&_parameter_))-%index(%nrbquote(&_parameter_), %str(:)))-1))))); %end; %let _lines3_=1; %do %while(%length(%nrbquote(&_parameter_))>%eval(%eval(95-&_maxparamnamelen_)-6)); %let _substr3_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_parameter_))), 1, %eval(%eval(96-&_maxparamnamelen_)-6))); %if (%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_parameter_))), %eval(%eval(96-&_maxparamnamelen_)-7), 1)) eq %quote( )) %then %do; %let _parameter_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_parameter_))), %eval(%eval(96-&_maxparamnamelen_)-7), %eval(%length(%nrbquote(&_parameter_))-%eval(%eval(96-&_maxparamnamelen_)-6)))); %let _currstr3_=%nrbquote(&_substr3_); %end; %else %do; %let _currstr3_=; %let _subscnt3_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&_substr3_), %eval(&_subscnt3_+1), %str( ))))); %let _subscnt3_=%eval(&_subscnt3_+1); %let _wordsub3_=%nrbquote(%qscan(%nrbquote(&_substr3_), &_subscnt3_, %str( ))); %if (%length(%nrbquote(%qscan(%nrbquote(&_substr3_), %eval(&_subscnt3_+1), %str( ))))) %then %do; %let _currstr3_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr3_)))))%str( )%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub3_))))); %let _parameter_=%nrbquote(%left(%nrbquote(&_parameter_))); %let _parameter_=%nrbquote(%substr(%nrbquote(&_parameter_), %eval(%length(%nrbquote(&_wordsub3_))+2), %eval(%eval(%length(%nrbquote(&_parameter_))-%length(%nrbquote(&_wordsub3_)))-1))); %end; %end; %end; str2=trimn(left("&_currstr3_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines3_ eq 1) %then %do; tmp=length(str2); put '|' @6 "%trim(%nrbquote(%left(%nrbquote(&_paraname_))))" @%eval(&_maxparamnamelen_+6) '-' @%eval(&_maxparamnamelen_+8) str2 @96 '|'; %end; %else %do; position2=%eval(&_maxparamnamelen_+8); put '|' @position2 str2 @96 '|'; %end; %let _lines3_=%eval(&_lines3_+1); %end; str2=trimn(left("&_parameter_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines3_ eq 1) %then %do; put '|' @6 "%trim(%nrbquote(%left(%nrbquote(&_paraname_))))" @%eval(&_maxparamnamelen_+6) '-' @%trim(%left(%eval(&_maxparamnamelen_+8))) str2 @96 '|'; %end; %else %do; position2=%eval(&_maxparamnamelen_+8); if ^missing(str2) then put '|' @position2 str2 @96 '|'; %end; %end; put '|' 35*'-' '<-- End of Parameters -->' 34*'-' @96 '|'; put '|' 94*'-' '|'; %end; %if (%length(%nrbquote(&lib)) gt 3) %then %do; put '|' 30*'-' '<-- Start of Library References -->' 30*'-' @96 '|'; str1="Library References: "; put '| ' str1 @96 '|'; %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&lib))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&lib)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(&lib))) gt 1) %then %let lib=%nrbquote(%substr(%nrbquote(&lib), 2, %eval(%length(%nrbquote(&lib))-2))); %else %let lib=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&lib))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&lib))))))-2))); %end; %let lib=%nrbquote(%sysfunc(compbl(%nrbquote(&lib)))); %if ((%index(%nrbquote(&lib),%str(%')) and %index(%nrbquote(&lib),%str(%')<2)) or (%index(%nrbquote(&lib),%str(%")) and %index(%nrbquote(&lib),%str(%")) lt 2)) %then %do; %let lib=%nrbquote(%sysfunc(dequote(%nrbquote(&lib)))); %end; %let lib=%nrbquote(%sysfunc(tranwrd(%nrbquote(&lib), %str(%(), %str(À)))); %let lib=%nrbquote(%sysfunc(tranwrd(%nrbquote(&lib), %str(%)), %str(Á)))); %let lib=%nrbquote(%sysfunc(tranwrd(%nrbquote(&lib), %str(%%), %str(Â)))); %let lib=%nrbquote(%sysfunc(tranwrd(%nrbquote(&lib), %str(%'), %str(¸)))); %let lib=%nrbquote(%sysfunc(tranwrd(%nrbquote(&lib), %str(%"), %str(¹)))); %let lib=%nrbquote(%qcmpres(&lib)); %let _nlib_=0; %do %while(%length(%nrbquote(%nrbquote(%qscan(%nrbquote(&lib), %eval(&_nlib_+1), %str(|)))))); %let _nlib_=%eval(&_nlib_+1); %let _library_=%nrbquote(%qscan(%nrbquote(&lib), &_nlib_, %str(|))); /*%if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_library_)))), %str(;)) ne 1) %then %let _library_=%nrbquote(&_library_)%str(;); */ %if (%index(%nrbquote(&_library_), %quote(:))) %then %let _libdlm_=%nrbquote(:); %else %if (%index(%nrbquote(&_library_), %quote(%)))) %then %let _libdlm_=%nrbquote()); %else %if (%index(%nrbquote(&_library_), %quote(-))) %then %let _libdlm_=%nrbquote(-); %else %let _libdlm_=%quote( ); %let _libname_ =%nrbquote(%qscan(%nrbquote(&_library_), 1 , %nrbquote(&_libdlm_))); %let _libname_=%nrbquote(%sysfunc(tranwrd(%nrbquote(&_libname_), %str(À), %str(%()))); %let _libname_=%nrbquote(%sysfunc(tranwrd(%nrbquote(&_libname_), %str(Á), %str(%))))); %let _libname_=%nrbquote(%sysfunc(tranwrd(%nrbquote(&_libname_), %str(Â), %str(%%)))); %let _libname_=%nrbquote(%sysfunc(tranwrd(%nrbquote(&_libname_), %str(¸), %str(%')))); %let _libname_=%nrbquote(%sysfunc(tranwrd(%nrbquote(&_libname_), %str(¹), %str(%")))); %let _library_=%nrbquote(%left(%nrbquote(%substr(%nrbquote(&_library_), %eval(%length(%nrbquote(&_libname_))+2), %eval(%eval(%eval(%length(%nrbquote(&_library_))-%length(%nrbquote(&_libname_))))-1))))); %if (%index(%nrbquote(&_library_),%str(\))) %then %let _dlm_=%str(\); %else %let _dlm_=%str(&_dlm_); %let _slashposlib_=%index(%nrbquote(&_library_),%str(\)); %if (&_slashposlib_ ge 1) %then %do; %if (&_slashposlib_ ge %eval(90-%length(%trim(%left(&_libname_))))) %then %let _dlm_=%quote( ); %else %if (%index(%nrbquote(&_library_),%str( ))) and (%index(%nrbquote(&_library_),%str( )) le 89) %then %do; %if (&_slashposlib_ gt %index(%nrbquote(&_library_),%str( ))) and (%eval(%length(&_library_) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_library_)))),%str(\))) ge 90) %then %let _dlm_=%quote(\); %else %let _dlm_=%quote( ); %end; %else %let _dlm_=%quote(\); %end; %else %let _dlm_=%str( ); %let _lines4_=1; %do %while(%length(%nrbquote(&_library_))>77); %let _slashposlib_=%index(%nrbquote(&_library_),%str(\)); %if (&_slashposlib_ ge 1) %then %do; %if (&_slashposlib_ ge ge %eval(90-%length(%trim(%left(&_libname_))))) %then %let _dlm_=%quote( ); %else %if (%index(%nrbquote(&_library_),%str( ))) and (%index(%nrbquote(&_library_),%str( )) le 89) %then %do; %if (&_slashposlib_ gt %index(%nrbquote(&_library_),%str( ))) and (%eval(%length(&_library_) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_library_)))),%str(\))) ge 90) %then %let _dlm_=%quote(\); %else %let _dlm_=%quote( ); %end; %else %let _dlm_=%quote(\); %end; %else %let _dlm_=%str( ); %let _substr4_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_library_))), 1, 77)); %if (%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_library_))), 78, 1)) eq %quote(&_dlm_)) %then %do; %let _library_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_library_))), 78, %eval(%length(%nrbquote(%left(%nrbquote(&_library_))))-77))); %let _currstr4_=%nrbquote(&_substr4_); %end; %else %do; %let _currstr4_=; %let _subscnt4_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&_substr4_), %eval(&_subscnt4_+1), %str(&_dlm_))))); %let _subscnt4_=%eval(&_subscnt4_+1); %let _wordsub4_=%nrbquote(%qscan(%nrbquote(&_substr4_), &_subscnt4_, %str(&_dlm_))); %if (%index(%quote(%sysfunc(reverse(%quote(&_currstr4_)))),%quote(\)) eq 1) and (%quote(&_dlm_) eq) %then %do; %let _currstr4_=%trim(%quote(%left(%quote(&_currstr4_))))%trim(%quote(%left(%quote(&_wordsub4_)))); %end; %else %if (%length(%quote(%qscan(%quote(&_substr4_), %eval(&_subscnt4_+1), %str(&_dlm_))))) %then %do; %if (%index(%nrbquote(&_dlm_),%str(\))) and (&_slashposlib_ lt 93) %then %let _currstr4_=%trim(%quote(%left(%quote(&_currstr4_))))%trim(%quote(%left(%quote(&_wordsub4_))))\; %else %if (%index(%nrbquote(&_dlm_),%str(\))) and ((%length(%trim(%quote(%left(%quote(&_currstr4_)))))<&_slashposlib_) and (&_slashposlib_>=93)) %then %let _currstr4_=%trim(%quote(%left(%quote(&_currstr4_)))) %trim(%quote(%left(%quote(&_wordsub4_)))); %else %if (%index(%nrbquote(&_dlm_),%str(\))) and ((%length(%trim(%quote(%left(%quote(&_currstr4_)))))>=&_slashposlib_) and (&_slashposlib_>=93)) %then %let _currstr4_=%trim(%quote(%left(%quote(&_currstr4_))))%trim(%quote(%left(%quote(&_wordsub4_))))\; %else %let _currstr4_=%trim(%quote(%left(%quote(&_currstr4_))))%str(&_dlm_)%trim(%quote(%left(%quote(&_wordsub4_)))); %let _library_=%trim(%quote(%left(%quote(&_library_)))); %let _library_=%substr(%quote(&_library_), %eval(%length(&_wordsub4_)+2), %eval(%eval(%length(&_library_)-%length(&_wordsub4_))-1)); %end; %end; %end; str2=trimn(left("&_currstr4_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines4_ eq 1) %then %do; put '|' @6 "%trim(%nrbquote(%left(%nrbquote(&_libname_))))" @17 '-' @19 str2 @96 '|'; %end; %else %do; position2=19; if ^missing(str2) then put '|' @position2 str2 @96 '|'; %end; %let _lines4_=%eval(&_lines4_+1); %end; str2=trimn(left("&_library_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines4_ eq 1) %then %do; put '|' @6 "%trim(%nrbquote(%left(%nrbquote(&_libname_))))" @17 '-' @19 str2 @96 '|'; %end; %else %do; position2=19; if ^missing(str2) then put '|' @position2 str2 @96 '|'; %end; %end; put '|' 31*'-' '<-- End of Library References -->' 30*'-' @96 '|'; put '|' 94*'-' '|'; %end; %if (%length(%nrbquote(&infile)) gt 3) %then %do; put '|' 33*'-' '<-- Start of Files Needed -->' 33*'-' @96 '|'; str1="Files Needed: "; put '| ' str1 @96 '|'; %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&infile))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&infile)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(&infile))) gt 1) %then %let infile=%nrbquote(%substr(%nrbquote(&infile), 2, %eval(%length(%nrbquote(&infile))-2))); %else %let infile=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&infile))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&infile))))))-2))); %end; %let infile=%nrbquote(%sysfunc(compbl(%nrbquote(&infile)))); %if ((%index(%nrbquote(&infile),%str(%')) and %index(%nrbquote(&infile),%str(%')<2)) or (%index(%nrbquote(&infile),%str(%")) and %index(%nrbquote(&infile),%str(%")) lt 2)) %then %do; %let infile=%nrbquote(%sysfunc(dequote(&infile))); %end; %let infile=%bquote(%sysfunc(tranwrd(%nrbquote(&infile), %str(%(), %str(À)))); %let infile=%bquote(%sysfunc(tranwrd(%nrbquote(&infile), %str(%)), %str(Á)))); %let infile=%bquote(%sysfunc(tranwrd(%nrbquote(&infile), %str(%%), %str(Â)))); %let infile=%bquote(%sysfunc(tranwrd(%nrbquote(&infile), %str(%'), %str(¸)))); %let infile=%bquote(%sysfunc(tranwrd(%nrbquote(&infile), %str(%"), %str(¹)))); %let infile=%qcmpres(&infile); %let _nfile_=0; %do %while(%length(%qscan(%quote(&infile), %eval(&_nfile_+1), %str(|)))); %let _nfile_=%eval(&_nfile_+1); %let _filel_=%qscan(%quote(&infile), &_nfile_, %str(|)); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&_filel_)))))))))) ne 1) %then %let _filel_=%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_filel_))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&_filel_)))))); /* %else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_filel_)))), %str(;)) ne 1) %then %let _filel_=&_filel_%str(;); */ %let _slashposl_=%index(%nrbquote(&_filel_),%str(\)); %if (&_slashposl_ ge 1) %then %do; %if (&_slashposl_ ge 90) %then %let _dlml_=%quote( ); %else %if (%index(%nrbquote(&_filel_),%str( ))) and (%index(%nrbquote(&_filel_),%str( )) le 89) %then %do; %if (&_slashposl_ gt %index(%nrbquote(&_filel_),%str( ))) and (%eval(%length(&_filel_) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_filel_)))),%str(\))) ge 90) %then %let _dlml_=%quote(\); %else %let _dlml_=%quote( ); %end; %else %let _dlml_=%quote(\); %end; %else %let _dlml_=%str( ); %let _lines5_=1; %do %while(%length(&_filel_)>89); %let _slashposl_=%index(%nrbquote(&_filel_),%str(\)); %if (&_slashposl_ ge 1) %then %do; %if (&_slashposl_ ge 90) %then %let _dlml_=%quote( ); %else %if (%index(%nrbquote(&_filel_),%str( ))) and (%index(%nrbquote(&_filel_),%str( )) le 89) %then %do; %if (&_slashposl_ gt %index(%nrbquote(&_filel_),%str( ))) and (%eval(%length(&_filel_) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_filel_)))),%str(\))) ge 90) %then %let _dlml_=%quote(\); %else %let _dlml_=%quote( ); %end; %else %let _dlml_=%quote(\); %end; %else %let _dlml_=%str( ); %let _substr5_=%substr(%quote(%left(%quote(&_filel_))), 1, 89); %if (%quote(%substr(%quote(%left(%quote(&_filel_))), 90, 1)) eq %quote(&_dlml_)) %then %do; %let _filel_=%substr(%quote(%left(%quote(&_filel_))), 90, %eval(%length(%left(%quote(&_filel_)))-89)); %let _currstr5_=&_substr5_; %end; %else %do; %let _currstr5_=; %let _subscnt5_=0; %do %while(%length(%qscan(%quote(&_substr5_), %eval(&_subscnt5_+1), %str(&_dlml_)))); %let _subscnt5_=%eval(&_subscnt5_+1); %let _wordsub5_=%qscan(%quote(&_substr5_), &_subscnt5_, %str(&_dlml_)); %if (%index(%quote(%sysfunc(reverse(%quote(&_currstr5_)))),%quote(\)) eq 1) and (%quote(&_dlml_) eq) %then %do; %let _currstr5_=%trim(%quote(%left(%quote(&_currstr5_))))%trim(%quote(%left(%quote(&_wordsub5_)))); %end; %else %if (%length(%quote(%qscan(%quote(&_substr5_), %eval(&_subscnt5_+1), %str(&_dlml_))))) %then %do; %if (%index(%nrbquote(&_dlml_),%str(\))) and (&_slashposl_ lt 93) %then %let _currstr5_=%trim(%quote(%left(%quote(&_currstr5_))))%trim(%quote(%left(%quote(&_wordsub5_))))\; %else %if (%index(%nrbquote(&_dlml_),%str(\))) and ((%length(%trim(%quote(%left(%quote(&_currstr5_)))))<&_slashposl_) and (&_slashposl_>=93)) %then %let _currstr5_=%trim(%quote(%left(%quote(&_currstr5_)))) %trim(%quote(%left(%quote(&_wordsub5_)))); %else %if (%index(%nrbquote(&_dlml_),%str(\))) and ((%length(%trim(%quote(%left(%quote(&_currstr5_)))))>=&_slashposl_) and (&_slashposl_>=93)) %then %let _currstr5_=%trim(%quote(%left(%quote(&_currstr5_))))%trim(%quote(%left(%quote(&_wordsub5_))))\; %else %let _currstr5_=%trim(%quote(%left(%quote(&_currstr5_))))%str(&_dlml_)%trim(%quote(%left(%quote(&_wordsub5_)))); %let _filel_=%left(%quote(&_filel_)); %let _filel_=%substr(%quote(&_filel_), %eval(%length(&_wordsub5_)+2), %eval(%eval(%length(&_filel_)-%length(&_wordsub5_))-1)); %end; %end; %end; str2=trimn(left("&_currstr5_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines5_ eq 1) %then %do; put '|' @6 str2 @96 '|'; %end; %else %do; put '|' @6 str2 @96 '|'; %end; %let _lines5_=%eval(&_lines5_+1); %end; str2=trimn(left("&_filel_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines5_ eq 1) %then %do; put '|' @6 str2 @96 '|'; %end; %else %do; if ^missing(str2) then put '|' @6 str2 @96 '|'; %end; %if (%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%qscan(%nrbquote(&infile), %eval(&_nfile_+1), %str(|))))))))) %then %do; put '|' 94*' ' '|'; %end; %end; put '|' 34*'-' '<-- End of Files Needed -->' 33*'-' @96 '|'; put '|' 94*'-' '|'; %end; %if (%length(%nrbquote(&outfile)) gt 3) %then %do; put '|' 32*'-' '<-- Start of Files Created -->' 32*'-' @96 '|'; str1="Files Created: "; put '| ' str1 @96 '|'; %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&outfile))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&outfile)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(&outfile))) gt 1) %then %let outfile=%nrbquote(%substr(%nrbquote(&outfile), 2, %eval(%length(%nrbquote(&outfile))-2))); %else %let outfile=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&outfile))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&outfile))))))-2))); %end;%let outfile=%nrbquote(%sysfunc(compbl(%nrbquote(&outfile)))); %if ((%index(%nrbquote(&outfile),%str(%')) and %index(%nrbquote(&outfile),%str(%')<2)) or (%index(%nrbquote(&outfile),%str(%")) and %index(%nrbquote(&outfile),%str(%")) lt 2)) %then %do; %let outfile=%nrbquote(%sysfunc(dequote(%nrbquote(&outfile)))); %end; %let outfile=%nrbquote(%sysfunc(tranwrd(%nrbquote(&outfile), %str(%(), %str(À)))); %let outfile=%nrbquote(%sysfunc(tranwrd(%nrbquote(&outfile), %str(%)), %str(Á)))); %let outfile=%nrbquote(%sysfunc(tranwrd(%nrbquote(&outfile), %str(%%), %str(Â)))); %let outfile=%nrbquote(%sysfunc(tranwrd(%nrbquote(&outfile), %str(%'), %str(¸)))); %let outfile=%nrbquote(%sysfunc(tranwrd(%nrbquote(&outfile), %str(%"), %str(¹)))); %let outfile=%nrbquote(%qcmpres(%nrbquote(&outfile))); %let _nfilec_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&outfile), %eval(&_nfilec_+1), %str(|))))); %let _nfilec_=%eval(&_nfilec_+1); %let _filec_=%nrbquote(%qscan(%nrbquote(&outfile), &_nfilec_, %str(|))); %if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&_filec_)))))))))) ne 1) %then %let _filec_=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_filec_))))), 1, %length(%trim(%nrbquote(%left(%nrbquote(&_filec_))))))); /*%else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_filec_)))), %str(;)) ne 1) %then %let _filec_=%nrbquote(&_filec_)%str(;); */ %let _slashposc_=%index(%nrbquote(&_filec_),%str(\)); %if (&_slashposc_ ge 1) %then %do; %if (&_slashposc_ ge 90) %then %let _dlmc_=%quote( ); %else %if (%index(%nrbquote(&_filec_),%str( ))) and (%index(%nrbquote(&_filec_),%str( )) le 89) %then %do; %if (&_slashposc_ gt %index(%nrbquote(&_filec_),%str( ))) and (%eval(%length(%nrbquote(&_filec_)) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_filec_)))),%str(\))) ge 90) %then %let _dlmc_=%quote(\); %else %let _dlmc_=%quote( ); %end; %else %let _dlmc_=%quote(\); %end; %else %let _dlmc_=%str( ); %let _lines6_=1; %do %while(%length(%nrbquote(&_filec_))>89); %let _slashposc_=%index(%nrbquote(&_filec_),%str(\)); %if (&_slashposc_ ge 1) %then %do; %if (&_slashposc_ ge 90) %then %let _dlmc_=%quote( ); %else %if (%index(%nrbquote(&_filec_),%str( ))) and (%index(%nrbquote(&_filec_),%str( )) le 89) %then %do; %if (&_slashposc_ gt %index(%nrbquote(&_filec_),%str( ))) and (%eval(%length(%nrbquote(&_filec_)) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_filec_)))),%str(\))) ge 90) %then %let _dlmc_=%quote(\); %else %let _dlmc_=%quote( ); %end; %else %let _dlmc_=%quote(\); %end; %else %let _dlmc_=%str( ); %if (%length(%nrbquote(&_filec_)) ge 90) %then %let _substr6_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_filec_))), 1, 89)); %if (%length(%nrbquote(&_filec_)) ge 90) %then %if (%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_filec_))), 90, 1)) eq %quote(&_dlmc_)) %then %do; %let _filec_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_filec_))), 90, %eval(%length(%nrbquote(%left(%nrbquote(&_filec_))))-89))); %let _currstr6_=%nrbquote(&_substr6_); %end; %else %do; %let _currstr6_=; %let _subscnt6_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&_substr6_), %eval(&_subscnt6_+1), %str(&_dlmc_))))); %let _subscnt6_=%eval(&_subscnt6_+1); %let _wordsub6_=%nrbquote(%qscan(%nrbquote(&_substr6_), &_subscnt6_, %str(&_dlmc_))); %if (%index(%quote(%sysfunc(reverse(%quote(&_currstr6_)))),%quote(\)) eq 1) and (%quote(&_dlmc_) eq) %then %do; %let _currstr6_=%trim(%quote(%left(%quote(&_currstr6_))))%trim(%quote(%left(%quote(&_wordsub6_)))); %end; %else %if (%length(%nrbquote(%qscan(%nrbquote(&_substr6_), %eval(&_subscnt6_+1), %str(&_dlmc_))))) %then %do; %if (%index(%nrbquote(&_dlmc_),%str(\))) and (&_slashposc_ lt 93) %then %let _currstr6_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr6_)))))%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub6_)))))\; %else %if (%index(%nrbquote(&_dlmc_),%str(\))) and ((%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr6_))))))<&_slashposc_) and (&_slashposc_>=93)) %then %let _currstr6_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr6_))))) %nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub6_))))); %else %if (%index(%nrbquote(&_dlmc_),%str(\))) and ((%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr6_))))))>=&_slashposc_) and (&_slashposc_>=93)) %then %let _currstr6_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr6_)))))%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub6_)))))\; %else %let _currstr6_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr6_)))))%str(&_dlmc_)%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub6_))))); %let _filec_=%nrbquote(%left(%nrbquote(&_filec_))); %let _filec_=%nrbquote(%substr(%nrbquote(&_filec_), %eval(%length(%nrbquote(&_wordsub6_))+2), %eval(%eval(%length(%nrbquote(&_filec_))-%length(%nrbquote(&_wordsub6_)))-1))); %end; %end; %end; str2=trimn(left("&_currstr6_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines6_ eq 1) %then %do; put '|' @6 str2 @96 '|'; %end; %else %do; put '|' @6 str2 @96 '|'; %end; %let _lines6_=%eval(&_lines6_+1); %end; str2=trimn(left("&_filec_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines6_ eq 1) %then %do; put '|' @6 str2 @96 '|'; %end; %else %do; if ^missing(str2) then put '|' @6 str2 @96 '|'; %end; %if (%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%qscan(%nrbquote(&outfile), %eval(&_nfilec_+1), %str(|))))))))) %then %do; put '|' 94*' ' '|'; %end; %end; put '|' 33*'-' '<-- End of Files Created -->' 33*'-' @96 '|'; put '|' 94*'-' '|'; %end; %if (%length(%nrbquote(&comment)) gt 3) %then %do; put '|' 35*'-' '<-- Start of Comments -->' 35*'-' @96 '|'; str1="Comments: "; put '| ' str1 @96 '|'; %if (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&comment))))), %str(%()) eq 1) and (%index(%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&comment)))))))), %str(%))) eq 1) %then %do; %if (%sysfunc(rxmatch(%sysfunc(rxparse($(1))),%nrbquote(&comment))) gt 1) %then %let comment=%nrbquote(%substr(%nrbquote(&comment), 2, %eval(%length(%nrbquote(&comment))-2))); %else %let comment=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&comment))))), 2, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&comment))))))-2))); %end; %let comment=%nrbquote(%sysfunc(compbl(%nrbquote(&comment)))); %if ((%index(%nrbquote(&comment),%str(%')) and %index(%nrbquote(&comment),%str(%')<2)) or (%index(%nrbquote(&comment),%str(%")) and %index(%nrbquote(&comment),%str(%")) lt 2)) %then %do; %let comment=%nrbquote(%sysfunc(dequote(%nrbquote(&comment)))); %end; %let comment=%nrbquote(%sysfunc(tranwrd(%nrbquote(&comment), %str(%(), %str(À)))); %let comment=%nrbquote(%sysfunc(tranwrd(%nrbquote(&comment), %str(%)), %str(Á)))); %let comment=%nrbquote(%sysfunc(tranwrd(%nrbquote(&comment), %str(%%), %str(Â)))); %let comment=%nrbquote(%sysfunc(tranwrd(%nrbquote(&comment), %str(%'), %str(¸)))); %let comment=%nrbquote(%sysfunc(tranwrd(%nrbquote(&comment), %str(%"), %str(¹)))); %let comment=%nrbquote(%qcmpres(%nrbquote(&comment))); %let _ncomm_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&comment), %eval(&_ncomm_+1), %str(|))))); %let _ncomm_=%eval(&_ncomm_+1); %let _commitem_=%nrbquote(%qscan(%nrbquote(&comment), &_ncomm_, %str(|))); /*%if (%sysfunc(rxmatch(%sysfunc(rxparse($a|$d)),%nrbquote(%trim(%nrbquote(%left(%nrbquote(%sysfunc(reverse(%nrbquote(&_commitem_)))))))))) ne 1) %then %let _commitem_=%nrbquote(%substr(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_commitem_))))), 1, %eval(%length(%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_commitem_))))))-1)))%str(;); %else %if (%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_commitem_)))), %str(;)) ne 1) %then %let _commitem_=%nrbquote(&_commitem_)%str(;); */ %let _slashposcm_=%index(%nrbquote(&_commitem_),%str(\)); %if (&_slashposcm_ ge 1) %then %do; %if (&_slashposcm_ ge 90) %then %let _dlmcomm_=%quote( ); %else %if (%index(%nrbquote(&_commitem_),%str( ))) and (%index(%nrbquote(&_commitem_),%str( )) le 89) %then %do; %if (&_slashposcm_ gt %index(%nrbquote(&_commitem_),%str( ))) and (%eval(%length(%nrbquote(&_commitem_)) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_commitem_)))),%str(\))) ge 90) %then %let _dlmcomm_=%quote(\); %else %let _dlmcomm_=%quote( ); %end; %else %let _dlmcomm_=%quote(\); %end; %else %let _dlmcomm_=%str( ); %let _lines7_=1; %do %while(%length(%nrbquote(&_commitem_))>89); %let _slashposcm_=%index(%nrbquote(&_commitem_),%str(\)); %if (&_slashposcm_ ge 1) %then %do; %if (&_slashposcm_ ge 90) %then %let _dlmcomm_=%quote( ); %else %if (%index(%nrbquote(&_commitem_),%str( ))) and (%index(%nrbquote(&_commitem_),%str( )) le 89) %then %do; %if (&_slashposcm_ gt %index(%nrbquote(&_commitem_),%str( ))) and (%eval(%length(&_commitem_) -%index(%nrbquote(%sysfunc(reverse(%nrbquote(&_commitem_)))),%str(\))) ge 90) %then %let _dlmcomm_=%quote(\); %else %let _dlmcomm_=%quote( ); %end; %else %let _dlmcomm_=%quote(\); %end; %else %let _dlmcomm_=%str( ); %let _substr7_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_commitem_))), 1, 89)); %if (%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_commitem_))), 90, 1)) eq %nrbquote(&_dlmcomm_)) %then %do; %let _commitem_=%nrbquote(%substr(%nrbquote(%left(%nrbquote(&_commitem_))), 90, %eval(%length(%nrbquote(%left(%nrbquote(&_commitem_))))-89))); %let _currstr7_=%nrbquote(&_substr7_); %end; %else %do; %let _currstr7_=; %let _subscnt7_=0; %do %while(%length(%nrbquote(%qscan(%nrbquote(&_substr7_), %eval(&_subscnt7_+1), %str(&_dlmcomm_))))); %let _subscnt7_=%eval(&_subscnt7_+1); %let _wordsub7_=%nrbquote(%qscan(%nrbquote(&_substr7_), &_subscnt7_, %str(&_dlmcomm_))); %if (%length(%nrbquote(%qscan(%nrbquote(&_substr7_), %eval(&_subscnt7_+1), %str(&_dlmcomm_))))) %then %do; %if (%quote(&_dlmcomm_) eq %quote(\)) %then %let _currstr7_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr7_)))))%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub7_)))))%str(&_dlmcomm_); %else %let _currstr7_=%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_currstr7_)))))%str(&_dlmcomm_)%nrbquote(%trim(%nrbquote(%left(%nrbquote(&_wordsub7_))))); %let _commitem_=%nrbquote(%left(%nrbquote(&_commitem_))); %let _commitem_=%nrbquote(%substr(%nrbquote(&_commitem_), %eval(%length(%nrbquote(&_wordsub7_))+2), %eval(%eval(%length(%nrbquote(&_commitem_))-%length(%nrbquote(&_wordsub7_)))-1))); %end; %end; %end; str2=trimn(left("&_currstr7_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines7_ eq 1) %then %do; put '|' @6 str2 @96 '|'; %end; %else %do; put '|' @6 str2 @96 '|'; %end; %let _lines7_=%eval(&_lines7_+1); %end; str2=trimn(left("&_commitem_")); str2=tranwrd(str2, '¸', "'"); str2=tranwrd(str2, '¹', '"'); str2=tranwrd(str2, 'Â', '%'); str2=tranwrd(str2, 'À', '('); str2=tranwrd(str2, 'Á', ')'); %if (&_lines7_ eq 1) %then %do; put '|' @6 str2 @96 '|'; %end; %else %do; if ^missing(str2) then put '|' @6 str2 @96 '|'; %end; %if (%length(%nrbquote(%qscan(%nrbquote(&comment), %eval(&_ncomm_+1), %str(|))))) %then %do; put '|' 94*' ' '|'; %end; %end; put '\' 35*'-' '<-- End of Comments -->' 35*'-' @95 '*/'; %end; end; if linecontent ne ' ' then do; atposition=length(linecontent)-length(trimn(left(linecontent))); put @atposition linecontent; end; run; %if (%index(%quote(%upcase(&tofile)), T)) %then %do; proc datasets library=work nolist; delete _tmp1_; run;quit; %end; %let syslast=&_tmplast_; options ls=&linesize ps=&pagesize; %mend GenHeader;